<!DOCTYPE html>
<html>
<head>
    <title>字典管理</title>
    <#include "/header.html">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="!showList && !showFieldList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
            <div class="form-group">
                <div class="col-sm-2 control-label">文件路径</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="dynamicCodeGenerator.filePath" placeholder="文件路径"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">下划线命名</div>
                <div class="col-sm-10">
                    <label class="checkbox-inline">
                        <input type="checkbox" style="margin-top: -4px;" true-value="1" false-value = "0" v-model="dynamicCodeGenerator.keyGeneratorType" :checked="dynamicCodeGenerator.keyGeneratorType==1"/>
                    </label>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="nextStep" value="下一步"/>
            </div>
        </form>
    </div>

    <div v-show="showFieldList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
            <div class="form-group">
                <div class="col-sm-2 control-label">系统Code</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="dynamicCodeGenerator.systemCode" placeholder="系统Code"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">业务Code</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="dynamicCodeGenerator.businessCode" placeholder="业务Code"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">业务主键</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="dynamicCodeGenerator.businessKey" placeholder="业务主键"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">备份文件</div>
                <div class="col-sm-10">
                    <label class="checkbox-inline">
                        <input type="checkbox" style="margin-top: -4px;" v-model="dynamicCodeGenerator.backupFile"/>
                    </label>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">生成新文件</div>
                <div class="col-sm-10">
                    <label class="checkbox-inline">
                        <input type="checkbox" style="margin-top: -4px;" v-model="dynamicCodeGenerator.generateNewFile"/>
                    </label>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">替换文件</div>
                <div class="col-sm-10">
                    <label class="checkbox-inline">
                        <input type="checkbox" style="margin-top: -4px;" v-model="dynamicCodeGenerator.replaceFile"/>
                    </label>
                </div>
            </div>

            <!-- -->
            <div class="panel panel-default">
                <table id="contentTable" class="table table-striped table-bordered table-condensed">
                    <thead>
                    <tr>
                        <th title="是否国际化">国际化</th>
                        <th title="默认读取数据库字段备注">系统Code</th>
                        <th title="数据库中设置的字段类型及长度">业务Code</th>
                        <th title="实体对象的属性字段类型">业务主键</th>
                        <th title="">业务Key <i class="icon-question-sign"></i></th>
                        <th title="是否是数据库主键">自定义国际化Bean名称</th>
                        <th title="">国际化类型</th>
                    </tr>
                    </thead>
                    <tbody v-for="(config,index) in dynamicCodeGenerator.configList">
                    <tr class="error" title="已删除的列，保存之后消失！">
                        <td>
                            <input type="checkbox" v-model="config.translate" :checked="config.translate==true"/>
                        </td>
                        <td>
                            <input type="text" v-model="config.systemCode" maxlength="200" class="required" style="width:100px;"/>
                        </td>
                        <td>
                            <input type="text" v-model="config.businessCode" maxlength="200" class="required" style="width:100px;"/>
                        </td>
                        <td>
                            <input type="text" v-model="config.businessKey" maxlength="200" class="required" style="width:100px;"/>
                        </td>
                        <td>
                            <input type="text" v-model="config.value" maxlength="200" class="required" style="width:100px;"/>
                        </td>
                        <td>
                            <input type="text" v-model="config.metaCalculator" maxlength="200" class="required" style="width:100px;"/>
                        </td>
                        <td>
                            <select v-model="config.i18nType" class="required input-mini">
                                <option v-for="dict in i18nTypeList"  :value="dict.value">{{dict.label}}</option>
                            </select>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
            </div>
        </form>

    </div>
</div>

<script src="${request.contextPath}/static/js/modules/code/dynamicCodeGenerator.js?_${.now?long}"></script>
</body>
</html>